package com.heima.account.action;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IAccountAction {

//    扣减金额：谁的 多少

    @TwoPhaseBusinessAction(name = "prepare",commitMethod = "commit",rollbackMethod = "rollback")
    public void prepare(@BusinessActionContextParameter(paramName = "userId") Integer userId,
                        @BusinessActionContextParameter(paramName = "money") Integer money);

    public boolean commit(BusinessActionContext context);

    public boolean rollback(BusinessActionContext context);
}
